package covertjava.decompile;

/**
 * <p>MessageInfo is used to send additional information with each message across
 * the network. Currently it contains the name of the host that the message
 * originalted from and the name of the user who sent it.</p>
 * <p>Copyright: Copyright (c) 2004 Sams Publishing</p>
 * @author Alex Kalinovsky
 * @version 1.0
 */
public class MessageInfo implements java.io.Serializable {

    String hostName;
    String userName;

    public MessageInfo(String hostName, String userName) {
        this.hostName = hostName;
        this.userName = userName;
    }

    /**
     * @return name of the host that sent the message
     */
    public String getHostName() {
        return hostName;
    }

    /**
     * @return name of the user that sent the message
     */
    public String getUserName() {
        return userName;
    }


    /**
     * Convenience method to obtain a string that best identifies the user.
     * @return name that should be used to identify a user that sent this message
     */
    public String getDisplayName() {
        return getHostName();
    }
}
